Motion detectors have found wide use in domestic and commercial applications. Motion sensors are used in a variety of settings. A motion detector may be among the sensors of a burglar alarm that is used to alert the home owner or security service when it detects the motion of a possible intruder. Traditional motion detectors utilize a technique called “background subtraction” to detect intruders. In background subtraction, an image's foreground is extracted for further processing (object recognition etc.). Generally an image's regions of interest are objects (humans, cars, etc.) in its foreground, such as a possible intruder. After image preprocessing, object localization is performed. While background subtraction is a widely used approach for detecting moving objects in videos obtained from static cameras, such as a security camera, the approach has limitations. The rationale in background subtraction is detecting the moving objects based on the difference between the current frame and a reference frame, often called “background image”, or “background model”. Background subtraction is generally performed when the image in question is a part of a video stream. Detecting motion using background subtraction is challenged by false alarms and detection failure, especially in environments with changing illumination and when an object, such as an intruder, blends into the background, such as when an intruder is wearing camouflage that closely matches the background.